<%--@elvariable id="roles" type="java.lang.string"--%>
<%--@elvariable id="user" type="com.weitu.permission.user.entity.user"--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8" %>
<!doctype html>
<html lang="zh">
<head>
    <title>用户角色授予</title>
    <%@include file="/common/header.jspf" %>
    <script type="text/javascript" src="${ctx}/resources/js/permission/userRole/edit.js"></script>
</head>
<body>
<div class="form-wrap">
    <form id="form_user" method="post">
        <div class="input-wrap">
            <label class="label">姓名：${user.realName}</label>
        </div>
        <c:forEach var="userDepartment" varStatus="item" items="${user.userDepartmentList}">
            <div class="input-wrap">
                <label class="label">部门：${userDepartment.deptName}</label>
                <ul class="tree-wrap role-tree easyui-tree" data-options="url:'${ctx}/permission/role/roleAndRoleGroupTree.shtml?userId=${user.id}&deptId=${userDepartment.deptId}',checkbox:true,onlyLeafCheck:true,lines:true"></ul>
                <input type="hidden" name="newDeptId" value="${userDepartment.deptId}">
            </div>
        </c:forEach>
        <div class="input-wrap hide">
            <input type="hidden" name="id" value="${user.id}">
            <input type="hidden" name="deptId" value="${param.deptId}">
            <c:forEach var="userDepartment" items="${user.userDepartmentList}">
                <input type="hidden" name="userDepartment" value="${userDepartment.deptId}">
            </c:forEach>
            <c:forEach var="userRole" items="${user.userRoleList}">
                <input type="hidden" name="roleId" value="${userRole.roleId}">
                <input type="hidden" name="deptId" value="${userRole.deptId}">
                <input type="hidden" name="roleName" value="${userRole.roleName}">
            </c:forEach>
        </div>
    </form>
    <div class="form-button">
        <a id="btn_save" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'fa fa-save fa-lg'">保存</a>
        <a id="btn_clear" href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'fa fa-remove fa-lg'">清空</a>
    </div>
</div>
</body>
</html>
